<html>
	<head>	
	</head>

	<?php

		$user = 'root';
		$server = 'localhost';

		$conexao = mysql_connect($server,$user,"");   
		mysql_select_db('extratime',$conexao);

	?>

	<body>
        <a href="enregistrer_client.php">Enregistrer un Client</a>
		<a href="enregistrer_restaurant.php">Enregistrer un Restaurant</a>
		<a href="enregistrer_user.php">Enregistrer Utilisateur</a>
        <a href="ajouter_file.php">Ajouter un Client </a>
		<a href="regarder_file.php">Regarder la file d'attente </a> 
		<fieldset>
			<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>" name="enregistrer_restaurant">
			<legend>Enregistrer un client</legend>
				<table>
					<tr>
						<td><label>Nom:  </label></td>
						<td><input type="text" size="50" name="restaurant_nom"></td>
					</tr>
					<tr>
						<td><label>Adresse: </label></td>
						<td><input type="text" size="15" name="restaurant_adresse"></td>
					</tr>					
					<tr>
						<td><label>Telephone</label></td>
						<td><input type="text" size="15" name="restaurant_telephone"></td>												
					</tr>
					<tr>
						<td><label>Code Postale: </label></td>
						<td><input type="text" size="15" name="restaurant_codepostale"></td>
					</tr>
					<tr>
						<td><label>Ville</label></td>
						<td><input type="text" size="15" name="restaurant_ville"></td>												
					</tr>
					<tr>
						<td><label>Pays</label></td>
						<td><input type="text" size="15" name="restaurant_pays"></td>												
					</tr>
				</table>
				<input type="hidden" name="verifica_envio" value="1" />
				<input type="submit" id="button"  name="enregistrer_restaurant" value="Enregistrer" />		
			</form>
		</fieldset>        
      
		<?php
			if(array_key_exists("verifica_envio",$_POST)){
				$NOM=$_POST['restaurant_nom'];
				$ADRESSE=$_POST['restaurant_adresse'];
				$TEL=$_POST['restaurant_telephone'];
				$CP=$_POST['restaurant_codepostale'];
				$VILLE=$_POST['restaurant_ville'];
				$PAYS=$_POST['restaurant_pays'];
				    
				$insert="INSERT INTO restaurant
					SET
						restaurant_nom='$NOM',
						restaurant_adresse='$ADRESSE',
						restaurant_telephone='$TEL',
						restaurant_codepostale='$CP',
						restaurant_ville='$VILLE',
						restaurant_pays='PAYS'";
				if($resultado = mysql_query($insert,$conexao)) {
					echo "Sucess!\n";
				}
				else{
					echo "Erreur\n";					
				}
			}	
		?>
	</body>
</html>
